home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
8206
/
8206.xpi
/
content
/
dialogs
/
formDlg.js
next >
Wrap
Text File
|
2010-02-02
|
2KB
|
58 lines
var formDlg = function() {
var pub = {};
pub.prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
pub.edit = null;
pub.onLoad = function()
{
var args = window.arguments[0];
//var dialog = document.getElementById("wisestamp_form_dlg");
document.title = args.title;
var container = document.getElementById("content");
if (args.intro != undefined)
{
var intro = container.appendChild(document.createElement("description"));
intro.appendChild(document.createTextNode(args.intro));
var separator = container.appendChild(document.createElement("separator"));
separator.setAttribute("class","thin");
}
var items = args.items;
for (id in items)
addItem(container,id,items[id]);
}
pub.onAccept = function()
{
var settings = window.arguments[0].settings;
var items = window.arguments[0].items;
for (id in items)
{
items[id].value = document.getElementById(id).value;
}
window.arguments[0].settings = settings;
window.arguments[0].result = true;
}
function addItem(container,id,param)
{
var hbox = container.appendChild(document.createElement("hbox"));
var label = hbox.appendChild(document.createElement("label"));
label.setAttribute("value",param.label + ":");
label.setAttribute("width","70");
var element = hbox.appendChild(document.createElement(param.type));
element.setAttribute("id",id);
}
return pub;
} ();